﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CQIE.OVS.Model;
using NHibernate.Criterion;

namespace CQIE.OVS.DAL
{
    public class UserDAL:DALBase<User>
    {
        public bool GetByAccount(string Account)
        {
            //SimpleQuery query = new SimpleQuery(typeof(UserInfo), "from UserInfo where Account=? and Password=?", model.Account, model.Password);
            //return (IList<UserInfo>)ExecuteQuery(query);
            //object[] parm = { model.Account, model.Password };
            //return Query("from UserInfo where Account=? and Password=?", parm);
            //数据查询的两种方法
            //1.单表
            IList<ICriterion> queryConditions = new List<ICriterion>();
            queryConditions.Add(Expression.Eq("Account", Account));
            var a = Exists(queryConditions);
            return a;
        }


    }
}
